<table width="560" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center" style="padding-left:3px; padding-right:3px">    
<?php
	include "connect.php";
	$sql="select * from sanpham where id_loai=4 and hienthi=1 and ghichu='hangdat' order by rand() limit 0,21";
	$kq=mysql_query($sql);
	while($r=mysql_fetch_array($kq))
	{
		$id=$r["id"];
		$tensp=$r["tensp"];	
		$hinh=$r["hinh"];		
		$gia=$r["gia"];
		$ghichu=$r["ghichu"];
		if($gia==0) $s="(liên hệ)";
		else { $s=$gia; }	
		echo "<div class=divshow>
		<table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background=\"images/box.gif\" style=\"border:1px dotted #999\">
		  <tr>
			<td height=170><a href=?b=ct&id=$id><img src='sanpham/small/$hinh' width=170px height=170 border=0> </a></td>
		  </tr>
		  <tr>
			<td height=25 style=\"font-size:14px; color:#F00\"><strong>$tensp</strong></td>
		  </tr>
		  <tr>
			<td height=25>Giá: $s</td>
		  </tr>
		</table>		
		</div";
	}
	$sql2="select * from sanpham where id_loai=4 and hienthi=1 order by rand() limit 0,21";
	$kq2=mysql_query($sql2);
	while($r2=mysql_fetch_array($kq2))
	{
		$id2=$r2["id"];
		$tensp2=$r2["tensp"];	
		$hinh2=$r2["hinh"];		
		$gia2=$r2["gia"];
		$ghichu2=$r2["ghichu"];
		if($gia2==0) $s2="(liên hệ)";
		else { $s2=$gia2; }
		if($ghichu2=="hangdat")
		echo "";
		else
		echo "<div class=divshow>
		<table width=175 height=220 border=0 cellspacing=0 cellpadding=0 background=\"images/box.gif\" style=\"border:1px dotted #999\">
		  <tr>
			<td height=170><a href=?b=ct&id=$id><img src='sanpham/small/$hinh2' width=170px height=170 border=0> </a></td>
		  </tr>
		  <tr>
			<td height=25 style=\"font-size:14px; color:#F00\"><strong>$tensp2</strong></td>
		  </tr>
		  <tr>
			<td height=25>Giá: $s2</td>
		  </tr>
		</table>		
		</div>";
	}
	
?>
	</td>
  </tr>
</table>